home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / Hermes / Hermes Toolbox 1.0.1 ƒ / What's New.p < prev   
Encoding:
Text File  |  1993-09-27  |  16.0 KB  |  233 lines  |  [TEXT/PJMM]

  1. {This is what is new in the last couple of versions of Hermes Toolbox}
  2.  
  3. unit WhatsNew;
  4.  
  5. interface
  6.  
  7. {•••••••••••••••••••••••••••New in verion 1.0•••••••••••••••••••••••••••••}
  8.  
  9.     function OpenDebugFile (HermSetup: UserXIPtr): integer;
  10. {-----------------------------------------------------------------------------------}
  11. {This function is just intended to make setting up a debugging file a little easier.  Calling it}
  12. {will open (or create) a file calle "Debug File" inside your Hermes Files folder.  It also stamps}
  13. {the time and date when it was opened to the file.  It returns a integer which is the file}
  14. {reference number or 0 if it wasn't able to open the file.  Save this number in your privates}
  15. {so you can write to the file and later to close it.}
  16. {-----------------------------------------------------------------------------------}
  17.  
  18.     procedure WriteDebugFile (theString: str255; debugRefNum: integer);
  19. {-----------------------------------------------------------------------------------}
  20. {Once again this is to simplify the logging of errors.  Pass it the refNum created by your}
  21. {call to "Open DebugFile" along with the string you want recorded and it will write it to the}
  22. {Debug file.  A return is automatically added to the end of the string.  There is no error}
  23. {checking here but for just testing that is probably preferable.}
  24. {-----------------------------------------------------------------------------------}
  25.  
  26.     procedure CloseDebugFile (debugRefNum: integer);
  27. {-----------------------------------------------------------------------------------}
  28. {This procedure will close the file created by "OpenDebugFile".  Pass it the refNum created}
  29. {by that procedure.}
  30. {-----------------------------------------------------------------------------------}
  31.  
  32.     procedure DebugString (theStr: str255; waitForReply: boolean);
  33. {-----------------------------------------------------------------------------------}
  34. {This procedure is great for debugging.  It requires that you have an freeware application}
  35. {called "Debug Window".  Pass a debugging string in theStr and this will send an AppleEvent}
  36. {to Debug Window that will log that string to the text window of "Debug Window".  This does}
  37. {not add a return to the end of the string but Debug Window has an option to automatically add}
  38. {them to each string that is sent.  The waitForReply variable determines whether it should}
  39. {wait for Debug Window to reply.  If true it will wait (up to 5 seconds) for a reply.  The}
  40. {advantage of waiting for a reply is that strings appear in the Debug Window one at a time}
  41. {as they are sent out.  That way you can watch both the Hermes window and Debug Window}
  42. {and see your debugging strings at the same time that event is taking place in Hermes.  If you}
  43. {don't wait for a reply the stings will tend to bunch up and it won't always be apparent at}
  44. {what stage they generated in Hermes.  The disadvantage to waiting for a reply is that it}
  45. {slows Hermes down some.  Since you will only use this for debugging this is probably}
  46. {acceptable but you have the option to no wait.  This procedure requires System 7 of course.}
  47. {***Note*** As with all debugging procedures, don't forget to take these out before you}
  48. {ship your external.  You can't tell its there but you don't want it there in your finished}
  49. {external.}
  50. {-----------------------------------------------------------------------------------}
  51.  
  52.     procedure DebugTimestamp (waitForReply: boolean);
  53. {-----------------------------------------------------------------------------------}
  54. {This procedure will cause Debug Window to stamp the time and date in the Debug Window.}
  55. {See DebugString for details.}
  56. {-----------------------------------------------------------------------------------}
  57.  
  58.     procedure DebugClearWindow (waitForReply: boolean);
  59. {-----------------------------------------------------------------------------------}
  60. {This procedure will clear the window in Debug Window.  See DebugString for details.}
  61. {-----------------------------------------------------------------------------------}
  62.  
  63. {•••••••••••••••••••••••••••New in verion 0.9•••••••••••••••••••••••••••••}
  64.  
  65.     function CheckRegistration (bbsName: str255; registrationNum: longInt; regNum1, regNum2: longint): boolean;
  66. {-----------------------------------------------------------------------------------}
  67. {This procedure will check a registration number for a given BBS name.  It returns true if the}
  68. {registration number is valid and false if it is invalid.  This relies on regNum1 and regNum2 }
  69. {regNum1 should be a 6 digit number and regNum2 should be a 3 digit number.  These numbers}
  70. {should be changed for each external.  You must use the same numbers that you used when you}
  71. {created the number with CreateRegistration though.}
  72. {-----------------------------------------------------------------------------------}
  73.  
  74.     function CreateRegistration (bbsName: str255; regNum1, regNum2: longint): longint;
  75. {-----------------------------------------------------------------------------------}
  76. {This procedure will return a registration number for the bbsName you pass it.  It also relies}
  77. {on regNum1 and regNum2 (see above).  You can use this is a small application or external}
  78. {that creates registration numbers.  You should define these two numbers as constants and}
  79. {use the same ones to create and then check registration numbers.}
  80. {-----------------------------------------------------------------------------------}
  81.  
  82. {•••••••••••••••••••••••••••New in verion 0.8•••••••••••••••••••••••••••••}
  83.  
  84.     procedure DoTimeDialog (var hour, minute: integer);
  85. {-----------------------------------------------------------------------------------}
  86. {This procedure puts up a dialog similar to that which Hermes uses to enter the time for node}
  87. {start and end time.  It gives the sysop the opportunity to enter time in a manner similar to}
  88. {that used by the Alarm Clock DA and General control panel.  It returns the hour and minute}
  89. {that the sysop entered.  The hour is in 24 hour format so 0 is midnight and 23 is 11 pm.}
  90. {Note that this dialog is modal so it will stop other action on the BBS, but this isn't really a}
  91. {problem since the sysop will  use it rarely. If you use this function you MUST include all}
  92. {the resources included in the file with the same name as this function.  Use ResEdit to copy}
  93. {them to your external's resource file.  There is a text item in this dialog which can be used}
  94. {to prompt the user.  You can either change it with ResEdit or call ParamText and set string}
  95. {number 0 to what you want displayed in that item.}
  96. {-----------------------------------------------------------------------------------}
  97.  
  98.     function StuffitExists: boolean;
  99. {-----------------------------------------------------------------------------------}
  100. {This function will check for the existence of the Stuffit Engine.  The Stuffit Engine is}
  101. {supposed to be kept in the Extensions folder inside the System Folder.  It returns true if the}
  102. {Engine is found and false if not.  Most of the other Stuffit Functions call this one but you}
  103. {should still check before using any of them so you can report back to the user.}
  104. {-----------------------------------------------------------------------------------}
  105.  
  106.     function StuffFile (source, destination: str255; deleteOriginal: boolean): OSErr;
  107. {-----------------------------------------------------------------------------------}
  108. {This function will compress a single file using the Stuffit Engine which is part of the Stuffit}
  109. {Deluxe package.  You should pass the path to the file to be compressed in source and where}
  110. {you want the archive to be placed in destination.  If deleteOriginal is true then the file will}
  111. {be deleted after it has been compressed.   This function does not add .sit to the end of the}
  112. {file name so if you are putting the new archive in the same directory you will need to add}
  113. {it yourself in the destination name.  The fuction returns any OSErr that might take place}
  114. {and returns -1 if the user cancels the operation by hitting the stop button in the Stuffit}
  115. {Engine dialog.  Although this function calls StuffitExists you should before calling it in order}
  116. {to report any errors to the user.}
  117. {-----------------------------------------------------------------------------------}
  118.  
  119.     function TouchFolder (folderPath: str255): OSErr;
  120. {-----------------------------------------------------------------------------------}
  121. {This procedure will chage the last modified date of a folder to the current time and date.}
  122. {This is often useful because it forces the Finder to update all the files in that folder.  Pass}
  123. {it the path to the folder you want to change and it will return any error.}
  124. {-----------------------------------------------------------------------------------}
  125.  
  126.     procedure FlushAllVolumes;
  127. {-----------------------------------------------------------------------------------}
  128. {This procdure will cause all mounted volumes to be immeadiately flushed.  All changes that}
  129. {have been made to files will be written to disk.  This is important because the mac doesn't}
  130. {write to disk until the buffer is full.  If you want to do something especially dangerous or}
  131. {something like shutdown the machine it might be a good idea to call this first.}
  132. {-----------------------------------------------------------------------------------}
  133.  
  134. {•••••••••••••••••••••••••••New in verion 0.7•••••••••••••••••••••••••••••}
  135.  
  136.     function FindUserOnline (userNum: integer; var node: integer; HermSetup: UserXIPtr): boolean;
  137. {-----------------------------------------------------------------------------------}
  138. {This function will return true if the user specified  by userNum  is online.  If true then the}
  139. {node that user is on will be returned in node.}
  140. {-----------------------------------------------------------------------------------}
  141.  
  142.     function NewUserAccount (var newUser: UserRec; HermSetup: UserXIPtr): OSErr;
  143. {-----------------------------------------------------------------------------------}
  144. {This function will create a new user on the BBS.  You can pass a full user record or use}
  145. {WriteUser to flesh it out later.  The new user's user number will be passed back in}
  146. {newUser.userNum.}
  147. {-----------------------------------------------------------------------------------}
  148.  
  149.     procedure CenterDialog (theDialog: DialogPtr);
  150. {-----------------------------------------------------------------------------------}
  151. {This procedure takes a dialog (or window) pointer (which you would get from GetNewDialog)}
  152. {and centers it on the screen.  You should make your dialog 'initially invisable' and call this}
  153. {procedure BEFORE calling ShowWindow.  Otherwise the user will see the dialog move across}
  154. {the screen.}
  155. {-----------------------------------------------------------------------------------}
  156.  
  157.     function DoRegistrationDialog (var bbsName: str255; var registrationNum: longInt): boolean;
  158. {-----------------------------------------------------------------------------------}
  159. {This function will put up a small dialog that will allow the sysop to enter basic registration}
  160. {information.  The dialog has two items, one for a BBS name and one for a registration}
  161. {number.  The function stores these two values in bbsName and registrationNum.  The dialog}
  162. {also has two buttons, one for OK and one for cancel.  The function will return true if the OK}
  163. {buttun is hit and false if cancel is hit.  Note that this dialog is modal so it will stop other}
  164. {action on the BBS, but this isn't really a problem since the sysop will  use it rarely. If you}
  165. {use this function you MUST include all the resources included in the file with the same name}
  166. {as this function.  Use ResEdit to copy them to your external's resource file.}
  167. {-----------------------------------------------------------------------------------}
  168.  
  169.     function GetRegistration (var bbsName: str255; var registrationNum: longInt; resourceName: resType): boolean;
  170. {-----------------------------------------------------------------------------------}
  171. {This function will let you get saved registration information.  It will retrieve the registration}
  172. {information in bbsName and registration number.  You must pass the resourceName that you}
  173. {previously used to save the information.  See SetRegistration for details.  It will return true}
  174. {if it found the resource and false if it did not.  If it did not find the resource you can create a}
  175. {new one by calling SetRegistration.}
  176. {-----------------------------------------------------------------------------------}
  177.  
  178.     procedure SetRegistration (bbsName: str255; registrationNum: longInt; resourceName: resType);
  179. {-----------------------------------------------------------------------------------}
  180. {This procedure will let you save registration information in your external's resource fork.}
  181. {Pass it the bbsName and registrationNum you want to save.  You also need to pass a}
  182. {resource type name.  This simply 4 letters (ie HRMS).  Each external you write should have}
  183. {its own type though to avoid possible conflicts.  Use the same type you use here as in}
  184. {GetRegistration.}
  185. {-----------------------------------------------------------------------------------}
  186.  
  187. {•••••••••••••••••••••••••••New in verion 0.6•••••••••••••••••••••••••••••}
  188.  
  189.     function FindAndReplace (theString: Str255; oldString, newString: Str255): str255;
  190. {-----------------------------------------------------------------------------------}
  191. {This function takes theString and replaces the first occurance of oldString with newString}
  192. {and returns the resulting string.}
  193. {-----------------------------------------------------------------------------------}
  194.  
  195.     function FindAndReplaceAll (theString: Str255; oldString, newString: Str255): str255;
  196. {-----------------------------------------------------------------------------------}
  197. {This function takes theString and replaces the all occurances of oldString with newString}
  198. {and returns the resulting string.}
  199. {-----------------------------------------------------------------------------------}
  200.  
  201.     function CheckCard (cardNum: str255; visa, master, amex, discover: boolean): boolean;
  202. {-----------------------------------------------------------------------------------}
  203. {Yea, yea this is getting strange but I needed it so why not make it avaliable.  This function}
  204. {will take a string representing a credit card number and will determine if the number is in}
  205. {the valid format.  Pass true in the remaining varialbes for each type of credit card that is}
  206. {acceptable.  In other words if you pass false for a varialbe that card type will  not be }
  207. {considered valid.  The cardNum string can have spaces although they are not necessary.}
  208. {All spaces will be ignored when evaluating the number.  This function does three things.}
  209. {First, it checks the first number of the card for the credit card type and sees if that type}
  210. {is accepted.  Second, it makes sure that the number is of the proper number of digits for}
  211. {each type.  Third , it does a checksum on the number to see if it is a possible credit card}
  212. {number. This checksum is fairly involved and is not something you would want to do in}
  213. {your head but it is a good way to check cards.  A number which passes these checks is}
  214. {not necessarily valid (ie it may not be assigned to anyone, stolen etc) but this is a good way}
  215. {to screen out fake numbers and mistakes.}
  216. {-----------------------------------------------------------------------------------}
  217.  
  218.     function CheckExpiration (expirationDate: str255): boolean;
  219. {-----------------------------------------------------------------------------------}
  220. {This function will take an expiration date (in the form MM/YY) and return whether this date}
  221. {has passed yet.  With this and CheckCard, assuming the information is given truthfully, you}
  222. {can confirm the validity of a credit card immeadiately.}
  223. {-----------------------------------------------------------------------------------}
  224.  
  225.     procedure SetMouse (newPoint: Point);
  226. {-----------------------------------------------------------------------------------}
  227. {This procedure will set the cursor to newPoint.  Why you would want to do this is beyond me}
  228. {but I had a reason to do so (the user doesn't ever notice).  This is a really rude thing to do}
  229. {and is a good way to have an program which flops (people hate the mouse moving on them)}
  230. {-----------------------------------------------------------------------------------}
  231.  
  232. implementation
  233. end.